<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="keywords"
          content="admin, dashboard, bootstrap, template, flat, modern, theme, responsive, fluid, retina, backend, html5, css, css3">
    <meta name="description" content="">
    <meta name="author" content="ThemeBucket">
    <link rel="shortcut icon" href="#" type="image/png">

    <title>教务系统管理--教务主任</title>

    <!--icheck-->
    <link href="${pageContext.request.contextPath}/static/js/iCheck/skins/minimal/minimal.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/js/iCheck/skins/square/square.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/js/iCheck/skins/square/red.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/js/iCheck/skins/square/blue.css" rel="stylesheet">

    <!--dashboard calendar-->
    <link href="${pageContext.request.contextPath}/static/css/clndr.css" rel="stylesheet">

    <!--Morris Chart CSS -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/js/morris-chart/morris.css">

    <!--common-->
    <link href="${pageContext.request.contextPath}/static/css/style.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/css/style-responsive.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="${pageContext.request.contextPath}/static/js/html5shiv.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/respond.min.js"></script>
    <![endif]-->
</head>

<body class="sticky-header">

<section>
    <!-- left side start-->
    <div class="left-side sticky-left-side">

        <!--logo and iconic logo start-->
        <div class="logo">
            <a href="index.html"><img src="${pageContext.request.contextPath}/static/images/login_edit.jpg" alt=""></a>
        </div>

        <div class="logo-icon text-center">
            <a href="index.html"><img src="${pageContext.request.contextPath}/static/images/logo_edit_min.jpg"
                                      alt=""></a>
        </div>
        <!--logo and iconic logo end-->

        <div class="left-side-inner">

            <!-- visible to small devices only -->
            <div class="visible-xs hidden-sm hidden-md hidden-lg">
                <div class="media logged-user">
                    <img alt="" src="${pageContext.request.contextPath}/static/images/photos/user-avatar.png"
                         class="media-object">
                    <div class="media-body">
                        <h4><a id="yourname1" href="#"></a></h4>
                        <span>"我是谁，我在哪里"</span>
                    </div>
                </div>

                <ul class="nav nav-pills nav-stacked custom-nav">
                    <li><a href="#"><i class="fa fa-user"></i> <span>个人信息</span></a></li>
                    <li><a href="#"><i class="fa fa-cog"></i> <span>设置</span></a></li>
                    <li><a href="#"><i class="fa fa-sign-out"></i> <span>退出</span></a></li>
                </ul>
            </div>

            <!--sidebar nav start-->
            <ul id="daoHangLan" class="nav nav-pills nav-stacked custom-nav">
                <li class="active"><a href="index.jsp"><i class="fa fa-home"></i> <span>主页</span></a></li>
                <li class="menu-list"><a href="#"><i class="fa fa-map-marker"></i> <span>考勤管理</span></a>
                    <ul class="sub-menu-list">
                        <li><a id="fbb5"> 考勤管理</a></li>
                        <li><a id="fbb6"> 旷课情况</a></li>
                        <li><a id="fbb7"> 迟到情况</a></li>
                        <li><a id="fbb8"> 早退情况</a></li>
                    </ul>
                </li>

                <li class="menu-list"><a href="#"><i class="fa fa-file-text"></i> <span id="showClasses">成绩管理</span></a>
                    <ul class="sub-menu-list" id="classesShow">

                    </ul>
                </li>

                <li class="menu-list"><a href="#"><i class="fa fa-bullhorn"></i> <span>综合查询</span></a>
                    <ul class="sub-menu-list">
                        <li><a href="basic_table.html"> Basic Table</a></li>
                        <li><a href="dynamic_table.html"> Advanced Table</a></li>
                        <li><a href="responsive_table.html"> Responsive Table</a></li>
                        <li><a href="editable_table.html"> Edit Table</a></li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
    <!-- left side end-->

    <!-- main content start-->
    <div class="main-content">

        <!-- header section start-->
        <div class="header-section">

            <!--toggle button start-->
            <a class="toggle-btn"><i class="fa fa-bars"></i></a>
            <!--toggle button end-->

            <!--search start-->
            <form class="searchform" action="" method="post">
                <input type="text" class="form-control" name="keyword" placeholder="搜索全部"/>
                <input type="button" class="form-control" style="width:66px" onclick="" value="搜索"/>
            </form>
            <!--search end-->

            <!--notification menu start -->
            <div class="menu-right">
                <ul class="notification-menu">
                    <li>
                        <a href="#" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                            <img src="${pageContext.request.contextPath}/static/images/photos/user-avatar.png" alt=""/>
                            <span id="yourName"></span>
                            <span class="caret"></span>
                        </a>
                        <ul class="dropdown-menu dropdown-menu-usermenu pull-right">
                            <li><a href="#"><i class="fa fa-user"></i> 个人信息</a></li>
                            <li><a href="#"><i class="fa fa-cog"></i> 设置</a></li>
                            <li><a href="${pageContext.request.contextPath}/login.jsp"><i class="fa fa-sign-out"></i> 退出</a>
                            </li>
                        </ul>
                    </li>

                </ul>
            </div>
            <!--notification menu end -->

        </div>
        <!-- header section end-->

        <!-- page heading start-->
        <div class="page-heading" style="height: 550px">
            <h3 id="rightPageName">
                主页
            </h3>
            <ul class="breadcrumb">
                <li>
                    <a id="rightPageNameFather" href="${pageContext.request.contextPath}/index.jsp">主页</a>
                </li>
                <li id="rightPageName_copy" class="active"></li>
            </ul>

            <!-- page heading end-->

            <!--body wrapper start-->
            <div class="wrapper">
                <div class="row">
                    <div class="col-md-12 col-sm-12" >
                        <iframe id="mainContent" scrolling="auto" width="100%" height="750px"
                                frameborder="0" seamless></iframe>
                    </div>
                </div>
            </div>
            <!--body wrapper end-->

            <!--footer section start-->
            <footer style="background:#eff0f4;">
                2020 &copy; 教务管理系统 by FarSightJavaEEGroupSeventh
            </footer>
            <!--footer section end-->


        </div>
        <!-- main content end-->
    </div>
</section>

<!-- Placed js at the end of the document so the pages load faster -->
<script src="${pageContext.request.contextPath}/static/js/jquery-1.10.2.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/jquery-ui-1.9.2.custom.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/jquery-migrate-1.2.1.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/modernizr.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/jquery.nicescroll.js"></script>


<!--common scripts for all pages-->
<script src="${pageContext.request.contextPath}/static/js/scripts.js"></script>


<script>
    //用a标签的id，通过点击事件来跳转路径，下面为模板（写在文档加载事件里面，processLoadPage()不要动！）
    $(function () {
        //获取名字
        var urlParam = decodeURI(window.location.href.split("?")[1]);
        var name = urlParam.split("name=")[1].split("&")[0];
        //console.log(name);
        $("#yourName").html(name);
        $("#yourname1").html(name);

        $("#mainContent").attr("src","${pageContext.request.contextPath}/index99.jsp?name="+name);
        //test为模板
        $("#test").click(function () {
            getBiaoTiName(this);
            processLoadPage("${pageContext.request.contextPath}/hello");//此处为自己的jsp文件路径
        });
        //马俊西
        $("#mjx1").click(function () {
            getBiaoTiName(this);
            processLoadPage("${pageContext.request.contextPath}/teacher/getTeacher");//此处为自己的jsp文件路径
        });
        $("#mjx2").click(function () {
            getBiaoTiName(this);
            processLoadPage("${pageContext.request.contextPath}/subject/subjectView");//此处为自己的jsp文件路径
        });
        $("#mjx3").click(function () {
            getBiaoTiName(this);
            processLoadPage("${pageContext.request.contextPath}/subject/subjectView");//此处为自己的jsp文件路径
        });
        //杨荣状
        $("#yrz1").click(function () {
            getBiaoTiName(this);
            processLoadPage("${pageContext.request.contextPath}/college/collegeView");//此处为自己的jsp文件路径
        });
        $("#yrz2").click(function () {
            getBiaoTiName(this);
            processLoadPage(" ${pageContext.request.contextPath}/class/classView");//此处为自己的jsp文件路径
        });
        $("#yrz3").click(function () {
            getBiaoTiName(this);
            processLoadPage("${pageContext.request.contextPath}/subject/subjectView");//此处为自己的jsp文件路径
        });
        $("#yrz4").click(function () {
            getBiaoTiName(this);
            processLoadPage("${pageContext.request.contextPath}/subject/subjectView");//此处为自己的jsp文件路径
        });
        $("#yrz8").click(function () {
            getBiaoTiName(this);
            processLoadPage(" ${pageContext.request.contextPath}/class/classView");//此处为自己的jsp文件路径
        });
        //范敬斌
        $("#fbb1").click(function () {
            getBiaoTiName(this);
            processLoadPage("${pageContext.request.contextPath}/classroom/classroomManage");//此处为自己的jsp文件路径
        });
        $("#fbb2").click(function () {
            getBiaoTiName(this);
            processLoadPage("${pageContext.request.contextPath}/classroom/classroomManage");//此处为自己的jsp文件路径
        });
        $("#fbb3").click(function () {
            getBiaoTiName(this);
            processLoadPage("${pageContext.request.contextPath}/classroom/classroomManage");//此处为自己的jsp文件路径
        });
        $("#fbb4").click(function () {
            getBiaoTiName(this);
            processLoadPage("${pageContext.request.contextPath}/classroom/classroomManage");//此处为自己的jsp文件路径
        });
        //fbb2
        $("#fbb5").click(function () {
            getBiaoTiName(this);
            processLoadPage("${pageContext.request.contextPath}/attendance/attendanceManage");//此处为自己的jsp文件路径
        });
        $("#fbb6").click(function () {
            getBiaoTiName(this);
            processLoadPage("${pageContext.request.contextPath}/attendance/kuKeMessage");//此处为自己的jsp文件路径
        });
        $("#fbb7").click(function () {
            getBiaoTiName(this);
            processLoadPage("${pageContext.request.contextPath}/attendance/chiDaoMessage");//此处为自己的jsp文件路径
        });
        $("#fbb8").click(function () {
            getBiaoTiName(this);
            processLoadPage("${pageContext.request.contextPath}/attendance/zaoTuiMessage");//此处为自己的jsp文件路径
        });

        //周鑫
        //显示班级列表
        $("#showClasses").click(function () {
            $.ajax({
                url:"${pageContext.request.contextPath}/page/showClassesByIndex",
                type:'get',
                dataType:'json',
                success:function (result) {
                    if (result.code == 0){
                        //alert(result.classesIndex)
                        showList(result.classesIndex);
                    }
                },
                error:function (err) {
                    console.log(JSON.stringify(err));

                }
            })
        });

        //显示班级数据信息
        function showList(classList) {
            var html = '';
            if(classList != 0) {
                for (var i = 0; i < classList.length; i++) {
                    var item = classList[i];
                    html+="<li>";
                    html+="<a onclick='showGradeByClassName(\""+item.collegeId + '\",\"' +item.classId  +"\")'>" + item.name +"</a>";
                    html+="</li>";
                }
            }
            $("#classesShow").html(html);
        };
        $("#studentInfo").click(function () {
            getBiaoTiName(this);
            processLoadPage("${pageContext.request.contextPath}/page/studentInformationPage");//此处为自己的jsp文件路径
        });


        //司徒炜豪
        $("#stwh1").click(function () {
            getBiaoTiName(this);
            processLoadPage("${pageContext.request.contextPath}/teachingInformation/classTeachingManage");//此处为自己的jsp文件路径
        });
        $("#stwh2").click(function () {
            getBiaoTiName(this);
            processLoadPage("${pageContext.request.contextPath}/teachingInformation/teachingManage");//此处为自己的jsp文件路径
        });
    })



    //周鑫
    function showGradeByClassName(collegeId,classId) {
        getBiaoTiName(this);
        processLoadPage("${pageContext.request.contextPath}/page/studentGradePage?collegeId=" + collegeId +"&classId="+classId);
    }

    //此处方法不要动
    //内置页面
    function processLoadPage(url) {
        $("#mainContent").attr("src",url);
    }
    //获取标签名字目录名字
    function getBiaoTiName(hhhh) {
        var biaoTi = hhhh.text;
        var fatherBq = $(hhhh).parents(".menu-list").children("a").children("span").text();
        $("#rightPageName").html(biaoTi);
        $("#rightPageNameFather").html(fatherBq);
        $("#rightPageName_copy").html(biaoTi);
    }

    // 班级管理的导航栏
    $("#xl").click(function () {
        $.ajax({
            url:"${pageContext.request.contextPath}/college/getcollegename",
            type:'get',
            dataType:'json',
            success:function (result) {
                if (result.code == 0){
                    xlk(result.collegename);
                }

            },
            error:function (err) {
                console.log(JSON.stringify(err));

            }
        })
    })
    function xlk(collegename) {
        console.log(JSON.stringify(collegename));
        var html = '';
        for (var i=0;i<collegename.length;i++){
            var item = collegename[i];
            console.log(JSON.stringify(item));
            html+="<li>";
            html+="<a onclick='getcollegeName(\""+item.collegeId+"\")'>" + item.name +"</a>";
            html+="</li>";
        }
        $("#tbb").html(html);
    }
    function getcollegeName(collegeId) {
        getBiaoTiName(this);
        processLoadPage("${pageContext.request.contextPath}/class/classView?collegeId="+collegeId);//此处为自己的jsp文件路径
    }

    //课程管理的导航栏
    $("#collegeManage").click(function () {
        $.ajax({
            url:"${pageContext.request.contextPath}/subject/getCollegeList",
            type:'post',
            dataType:'json',
            success:function (result) {
                if (result.code == 0){
                    insertSubject(result.collegeList);
                }
            },
            error:function (err) {
                console.log(JSON.stringify(err));
            }
        })
    })
    function insertSubject(collegeList) {
        console.log(JSON.stringify(collegeList));
        var html = '';
        for (var i=0;i<collegeList.length;i++){
            var item = collegeList[i];
            html+="<li>";
            html+="<a onclick='getcollegeNameToPage(\""+item.collegeId+"\")'>" + item.name +"</a>";
            html+="</li>";
        }
        $("#subjectList").html(html);
    }
    function getcollegeNameToPage(collegeId) {
        getBiaoTiName(this);
        processLoadPage("${pageContext.request.contextPath}/subject/subjectView?collegeId="+collegeId);//此处为自己的jsp文件路径
    }
</script>
</body>
</html>

